/**
 * 05/12/2013
 * 
 * OptionsActivity
 * 
 * Copyright GPL
 */
package com.jtmproject.javiertejedor.activities;

import com.jtmproject.javiertejedor.R;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * this class shows a preferences menu
 * @author Javier Tejedor
 */
public class OptionsActivity extends PreferenceActivity 
implements OnClickListener {
	
	private Button btnAccept;
	
    /* (non-Javadoc)
     * @see android.preference.PreferenceActivity#onCreate(android.os.Bundle)
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //deprecated (>_<)
        addPreferencesFromResource(R.xml.preferences);
        setContentView(R.layout.activity_options);
        btnAccept = (Button) this.findViewById(R.id.btn_accept);
        btnAccept.setOnClickListener(this);
    }
    
	/* (non-Javadoc)
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_accept:
			closeActivity();
			break;

		default:
			break;
		}
	}
	
	/**
	 * this closes the activity
	 */
	private void closeActivity(){
		OptionsActivity.this.finish();
	}
	
}
